import {Order} from "../../models/order.js"
var order = new Order()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    item: Object,
    orderType: String
  },

  /**
   * 组件的初始数据
   */
  data: {
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onOrderStatus(event){
      this.triggerEvent("orderstate")
    },

    changeOrderText(){
      var result = order.getOrderText(this.properties.item.status, this.properties.orderType)
      this.setData({
        btnDisable: result.disable,
        statusText: result.text
      })
    }
  }
})